The present invention relates to an image processing apparatus that stores image data, which is compressed by quantization based on random number dithering, in an image memory and decompresses the image data stored in the image memory by dequantization.
As an image communications standard used in a device having a liquid crystal display apparatus, such as a tablet personal computer (PC) and a notebook PC, there is the Embedded DisplayPort Standard.
The Embedded DisplayPort Standard includes a function, called Panel Self Refresh (PSR) as a technology for reducing the power consumption of the device. In the case of displaying an image using the function of PSR, a transmission side circuit stops the transmission of image data after the function of PSR performs switching from the display of a moving image in the case of normal operation to the display of a still image, and a reception side circuit included in an image processing apparatus of a liquid crystal display apparatus displays an image corresponding to image data stored in an image memory in the case of normal operation.
FIG. 9 is a block diagram of an example showing the configuration of an image processing apparatus of a liquid crystal display apparatus. An image processing apparatus 90 shown in FIG. 9 includes a receiving circuit 92, an image compression circuit 94, an image decompression circuit 96, an output image selection circuit 98, and a display control circuit 100.
In the case of normal operation, image data transmitted from a transmission side circuit 102 is received by the receiving circuit 92, and is output from the output image selection circuit 98. Under the control of the display control circuit 100, an image corresponding to the image data output from the output image selection circuit 98 is displayed on an image display apparatus 104.
In contrast, in the case of displaying an image using the function of PSR, the image data received by the receiving circuit 92 in the case of normal operation is compressed by the image compression circuit 94, and is stored in an image memory 106. Image data read from the image memory 106 according to the image display timing is decompressed by the image decompression circuit 96, and the decompressed image data is output from the output image selection circuit 98. Then, under the control of the display control circuit 100, an image corresponding to the image data output from the output image selection circuit 98 is displayed on the image display apparatus 104.
In the case of displaying an image using the function of PSR, it is possible to reduce the bandwidth and the capacity of the image memory 106 by applying compression processing on the image data stored in the image memory 106, as described above. However, when switching from the display of a moving image to the display of a still image, the displayed image is switched from a non-compressed image to a compressed image, and for this reason, perceivable degradation of image quality occurs due to compression processing, which is unfavorable.
In addition, the Embedded DisplayPort Standard includes a function called Panel Self Refresh 2 (PSR2) in which the transmission side circuit re-transmits image data of only a rectangular region, which is to be updated, in the entire image to perform Selective Update. In order to respond to the function of PSR2, as compression and decompression processing, it is required to independently encode and decode image data only in a part of the image, for example, by the line or by the block.
In image compression, conversion from the RGB color space to the YUV color space or the like is generally performed for the purpose of improving compression efficiency by reducing correlation between pieces of image data.
FIG. 10A is a block diagram of an example showing the configuration of the image compression circuit shown in FIG. 9. The image compression circuit 94 shown in FIG. 10A includes a color space conversion circuit 108 and first, second, and third encoding circuits 110, 112, and 114 as encoding circuits.
In the image compression circuit, the color space conversion circuit 108 converts image data of the RGB color space into Y image data, U image data, and V image data as image data of the YUV color space. Then, the first, second, and third encoding circuits respectively encode the Y image data, the U image data, and the V image data to generate Y compressed data, U compressed data, and V compressed data corresponding to the Y image data, the U image data, and the V image data, as compressed data.
FIG. 10B is a block diagram of an example showing the configuration of the image decompression circuit shown in FIG. 9. The image decompression circuit 96 shown in FIG. 10B includes first, second and third decoding circuits 140, 142, and 144 as decoding circuits, and an inverse color space conversion circuit 146.
In the image decompression circuit 96, the first, second and third decoding circuits 140, 142, and 144 respectively decode the Y compressed data, the U compressed data, and the V compressed data to generate Y image data, U image data, and V image data corresponding to the Y compressed data, the U compressed data, and the V compressed data, as decompressed data. Then, the inverse color space conversion circuit 146 inversely converts the Y image data, the U image data, and the V image data, so that the image data of the YUV color space is generated as the image data of the RGB color space.
FIG. 11 is a block diagram of an example showing the configuration of the encoding circuits shown in FIG. 10A. An encoding circuit 116 shown in FIG. 11 includes a quantization circuit 118, a first prediction circuit 120, and an entropy encoding circuit 122.
In the encoding circuit 116, the quantization circuit 118 generates quantized data by quantizing image data based on a quantization coefficient. Then, the first prediction circuit 120 generates differential data by subtracting quantized data, which is held in a data holding circuit and corresponds to an image temporally before the current image, from the quantized data generated by the quantization circuit 118. Then, the entropy encoding circuit 122 generates compressed data by entropy-encoding the differential data.
FIG. 12 is a block diagram of an example showing the configuration of the decoding circuits shown in FIG. 10B. A decoding circuit 124 shown in FIG. 12 includes an entropy decoding circuit 126, a second prediction circuit 128, and a dequantization circuit 130.
In the decoding circuit 124, the entropy decoding circuit 126 generates differential data by entropy-decoding the compressed data. Then, the second prediction circuit 128 generates quantized data by adding up the differential data generated by the entropy decoding circuit 126 and the quantized data which is held in a data holding circuit and corresponds to an image temporally before the current image. Then, the dequantization circuit 130 generates decompressed data by dequantizing the quantized data.
Arithmetic expressions of quantization and dequantization are shown, for example, as Formulae (1) and (2). For example, it is assumed that the quantization is simple one in which lower bit components of image data are truncated to round off the image data.Quantization: Quant=Floor((In+Q/2)/Q)  (1)Dequantization: DeQuant=Quant×Q  (2)
Here, In is input data, and Q is the value of a quantization coefficient.
In the above-described quantization in which lower bit components of image data are truncated, if the value Q of the quantization coefficient increases, the gradation of an image before compression processing changes smoothly as shown in FIG. 13. However, as shown in FIG. 14, the gradation of an image after compression and decompression changes stepwise, and therefore, the degradation of image quality is obvious. The reason therefor is that the smooth gradation of the image before compression processing collapses in the image after compression and decompression since values after quantization and dequantization are uniquely determined by input values.
Meanwhile, there is a technique called dithering that suppresses visual image degradation due to quantization error. In dithering, when quantization is performed, the lower bit components of image data is not truncated to simply round off the image data, but in the image data, for example, rounding-down or rounding-up of the lower bit components is controlled so as to reduce visual error. As one of the dithering, there is random number dithering.
FIG. 15 is a block diagram of an example showing the configuration of a random number dithering circuit. A random number dithering circuit 132 shown in FIG. 15 includes a pseudo random number generation circuit 134, an adder 136, and a quantization circuit 138.
In the random number dithering circuit 132, on the basis of a value Q of a quantization coefficient, the pseudo random number generation circuit 134 generates a pseudo random number in a range of 0 to Q−1. Then, the adder 136 generates addition data by adding up the image data and the pseudo random number, and the quantization circuit 138 generates quantized data by quantizing the addition data based on the quantization coefficient.
Arithmetic expressions quantization and dequantization are shown, for example, as Formulae (3) and (4). In the random number dithering circuit 132, addition of the pseudo random number is performed instead of rounding-off of image data.Quantization: Quant=Floor((In+Rand(Q))/Q)  (3)Dequantization: DeQuant=Quant×Q  (4)
Here, Rand(Q) is a pseudo random number generated based on the value Q of the quantization coefficient by the pseudo random number generation circuit 134.
As shown in Formulae (1) and (2), in simple quantization in which the lower bit components of image data are truncated, a value Out of output data is uniquely determined with respect to a value In of input data, as shown in FIG. 16A. In FIGS. 16A and 16B, the value Q of the quantization coefficient is 4.
In contrast, as shown in Formulae (3) and (4), in the case of quantization based on the random number dithering, the value Out of the output data is stochastically determined to a value in the vicinity of the value In of the input data. Accordingly, spatially or temporally, the average value is saved. As shown in FIG. 16B, for example, when the value In of the input data is 3, assuming that the probability that the value Out of the output data is quantized to 0 is 25% and the probability that the value Out of the output data is quantized to 4 is 75%, the average value of the value Out of the output data is 3. Degradation of the appearance of an image can be reduced by the characteristic that is “reversible on the average”.
FIG. 17 illustrates an image obtained after compression and decompression by quantization based on conventional random number dithering. The image shown in FIG. 17 is one obtained by applying the conventional random number dithering to the image shown in FIG. 13, and it can be seen that stepwise differences in gradation have been greatly removed compared with the image shown in FIG. 14.
In an image obtained by quantization based on the random number dithering, however, there is a problem that noise due to a pseudo random number is visually recognized like a pattern. This is because the manner of dithering varies depending on the gradation of the input value such that, for example, the output data is always quantized to 0 when the input value is 0, the output data is subjected to dithering with a probability of 25%:75% when the input value is 1, and the output data is subjected to dithering with a probability of 50%:50% when the input value is 2, as shown in FIG. 16E. For this reason, deviation arises in the quantization error, and the deviation is visually recognized like a pattern.
As prior art documents relevant to the present invention, there are JP 2013-195784 A, JP 2003-44847 A, JP 61-161871 A, JP 5-219384 A, and JP 2006-50299 A.
For example, JP 2013-195784 A describes that the undulation phenomenon, in which pseudo contour and stepwise differences in gradation are visually recognized as undulation, is eliminated by performing dithering using a random number.
JP 2003-44847 A describes that the effect of dithering in the vertical direction is obtained by switching the method of quantization among a plurality of lines.